package com.ciwong.epaper.modules.login;

import com.ciwong.epaper.application.EApplication;

/**
 * 登录契约类
 * Created by lqi on 2017/2/20.
 */
public interface LoginContract {

    interface LoginPresenter {

        void validateCredentials(String username, String password, String uuid, String captchaCode);

        void validateRealName(String userName, String realUserName, long schoolId, String schoolName, String password, String uuid, String captchaCode);


    }

    interface LoginView {

        boolean isValidUserName(String userName);

        boolean setUerNameError(String error);

        boolean setPasswordError(String error);

        boolean setSchoolNameError(String error);

        void showLoginProgress(boolean show);

        void showLoginErrorMsg(String msg);

        void navigateToHome(boolean isBindPhone, String pwd);
    }

    interface LoginModel {

        void login(EApplication application, String userId, String password, String uuid, String captchaCode, LoginFinishedListener listener, boolean isMobile);

        void loginByRealUserInfo(EApplication application, String userName, String realUserName, long schoolId, String schoolName, String password, String uuid, String captchaCode, LoginFinishedListener listener, boolean isMobile);
    }
}
